home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form1
- BorderStyle = 1 'Fixed Single
- Caption = "Animated Data Example"
- ClientHeight = 5340
- ClientLeft = 1380
- ClientTop = 4350
- ClientWidth = 7995
- Height = 5745
- Left = 1320
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 5340
- ScaleWidth = 7995
- Top = 4005
- Width = 8115
- Begin Threed.SSPanel pnlControls
- Height = 5175
- Left = 6000
- TabIndex = 1
- Top = 120
- Width = 1815
- _Version = 65536
- _ExtentX = 3201
- _ExtentY = 9128
- _StockProps = 15
- BackColor = 12632256
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BevelOuter = 1
- Begin VB.Frame fraChartType
- Caption = " Chart Type "
- Height = 2595
- Left = 180
- TabIndex = 4
- Top = 240
- Width = 1455
- Begin VB.OptionButton optChartType
- Caption = "Polar"
- Height = 195
- Index = 5
- Left = 240
- TabIndex = 11
- Top = 1860
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "Radar"
- Height = 195
- Index = 4
- Left = 240
- TabIndex = 10
- Top = 1560
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "3 D Bar"
- Height = 195
- Index = 3
- Left = 240
- TabIndex = 9
- Top = 1260
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "2 D Bar"
- Height = 195
- Index = 2
- Left = 240
- TabIndex = 8
- Top = 960
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "3 D Line"
- Height = 195
- Index = 1
- Left = 240
- TabIndex = 7
- Top = 660
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "2 D Line"
- Height = 195
- Index = 0
- Left = 240
- TabIndex = 6
- Top = 360
- Value = -1 'True
- Width = 1095
- End
- Begin VB.OptionButton optChartType
- Caption = "Surface"
- Height = 195
- Index = 6
- Left = 240
- TabIndex = 5
- Top = 2160
- Width = 1095
- End
- End
- Begin VB.CommandButton cmdStop
- Caption = "Stop"
- Height = 495
- Left = 300
- TabIndex = 3
- Top = 4440
- Width = 1215
- End
- Begin VB.CommandButton Command1
- Caption = "Start"
- Height = 495
- Left = 300
- TabIndex = 2
- Top = 3840
- Width = 1215
- End
- End
- Begin VtChartLib.VtChart VtChart1
- Height = 5055
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 5415
- _ExtentX = 9551
- _ExtentY = 8916
- _0 = $"Moving.frx":0000
- _1 = $"Moving.frx":0405
- _2 = $"Moving.frx":080B
- _3 = $"Moving.frx":0C10
- _4 = $"Moving.frx":1016
- _5 = $"Moving.frx":141B
- _6 = $"Moving.frx":1820
- _7 = $"Moving.frx":1C25
- _8 = $"Moving.frx":202A
- _9 = $"Moving.frx":242F
- _10 = $"Moving.frx":2836
- _11 = $"Moving.frx":2C3B
- _12 = $"Moving.frx":3040
- _13 = $"Moving.frx":3445
- _count = 14
- _ver = 1
- End
- Attribute VB_Name = "Form1"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim run As Boolean
- Dim gChartType%, gRows%, gCols%
- Private Sub cmdStop_Click()
- run = False
- End Sub
- Private Sub Command1_Click()
- Const AngleIncrement = 0.2
- Const PI = 3.14159264
- Static DataAngle#, aMin#
- MousePointer = 11 ' ' Wait cursor
- run = True
- While run
- '' Move existing data to the left
- VtChart1.DataGrid.MoveData 1, 1, gRows - 1, gCols, 0, 1
-
- DataAngle = DataAngle + AngleIncrement
- aMin = (DataAngle / PI) - 1
- If (aMin < 0) Then aMin = 0
-
- Select Case gChartType
- Case VtChChartType2dXY
- With VtChart1.DataGrid
- .SetData 1, 1, DataAngle / PI, False
- .SetData 1, 2, Sin(DataAngle), False
- .SetData 1, 3, DataAngle / PI, False
- .SetData 1, 4, Sin(DataAngle + PI / 2), False
- .SetData 1, 5, DataAngle / PI, False
- .SetData 1, 6, Sin(DataAngle - PI / 2), False
- End With
-
- Case VtChChartType3dLine, VtChChartType2dBar, VtChChartType3dBar, VtChChartType2dRadar
- With VtChart1.DataGrid
- .SetData 1, 3, Sin(DataAngle + PI / 2), False
- .SetData 1, 2, Sin(DataAngle), False
- .SetData 1, 1, Sin(DataAngle - PI / 2), False
- End With
-
- Case VtChChartType2dPolar
- With VtChart1.DataGrid
- .SetData 1, 1, (DataAngle * 30), False
- .SetData 1, 2, Cos(DataAngle), False
- .SetData 1, 3, (DataAngle * 50), False
- .SetData 1, 4, Cos(DataAngle), False
- .SetData 1, 5, (DataAngle * 10), False
- .SetData 1, 6, Cos(DataAngle), False
- End With
-
- Case VtChChartType3dSurface
- With VtChart1.DataGrid
- .SetData 1, 1, Sin(DataAngle), False
- .SetData 1, 2, Sin(DataAngle + AngleIncrement), False
- .SetData 1, 3, Sin(DataAngle + AngleIncrement * 2), False
- .SetData 1, 4, Sin(DataAngle + AngleIncrement * 3), False
- .SetData 1, 5, Sin(DataAngle + AngleIncrement * 4), False
- End With
-
- End Select
-
- VtChart1.Plot.Axis(VtChAxisIdX).ValueScale.Maximum = aMin + 1
- VtChart1.Plot.Axis(VtChAxisIdX).ValueScale.Minimum = aMin
-
- DoEvents
- Wend
- MousePointer = 0 ' default cursor
- End Sub
- Private Sub Form_Load()
- VtChart1.DrawMode = VtChDrawModeBlit
- Call optChartType_Click(0)
- run = False
- End Sub
- Private Sub Form_Resize()
- VtChart1.Repaint = False
- pnlControls.Left = ScaleWidth - pnlControls.Width - 60
- pnlControls.Height = ScaleHeight - 120
- VtChart1.Width = pnlControls.Left - 150
- VtChart1.Height = ScaleHeight - 120
- VtChart1.Repaint = True
- End Sub
- Private Sub optChartType_Click(Index As Integer)
- Select Case Index
- Case 0
- gChartType = VtChChartType2dXY
- gRows = 18
- gCols = 6
- Case 1
- gChartType = VtChChartType3dLine
- gRows = 18
- gCols = 3
- Case 2
- gChartType = VtChChartType2dBar
- gRows = 18
- gCols = 3
- Case 3
- gChartType = VtChChartType3dBar
- gRows = 18
- gCols = 3
- Case 4
- gChartType = VtChChartType2dRadar
- gRows = 18
- gCols = 3
- Case 5
- gChartType = VtChChartType2dPolar
- gRows = 18
- gCols = 6
- Case 6
- gChartType = VtChChartType3dSurface
- gRows = 5
- gCols = 5
- Case Else
- MsgBox "Chart type not available"
- Call optChartType_Click(0)
- End Select
-
- SetChartTypeAndSize VtChart1, gChartType, gRows, gCols
- ZeroGrid VtChart1
- End Sub
-